<template>
	<view class="shop-detail">
		<view class="title">
			<view class="btn" @click="goDetail">
				<image class="shop" src="../../../static/image/shop.png" mode="widthFix"></image>
				<text>去商城查看</text>
			</view>
			<text>商品详情</text>
			<text class="iconfont1 icon-guanbi1 close" @click="$emit('closePop')"></text>
		</view>
		<view class="content">
			<rich-text :nodes="goodsContent"></rich-text>
		</view>
	</view>
</template>

<script>
	import htmlParser from '@/common/js/html-parser';
	export default {
		props:{
			value:{
				type:Object,
				required:true
			}
		},
		computed:{
			goodsContent(){
				return htmlParser(this.value.content);
			}
		},
		data() {
			return {
			}
		},
		onLoad() {

		},
		methods: {
			goDetail(){
				this.$util.redirectTo('/pages/goods/detail/detail', { sku_id: this.value.sku_id });
			}
		}
	}
</script>

<style lang="scss" scoped>
	.shop-detail {
		width: 100%;
		border-top-left-radius: 45rpx;
		border-top-right-radius: 45rpx;
		.title {
			font-size: 35rpx;
			font-family: Source Han Sans CN;
			font-weight: bold;
			color: #111111;
			position: relative;
			height: 85rpx;
			line-height: 85rpx;
			text-align: center;
			margin-top: 13rpx;

			.btn {
				width: 201rpx;
				padding: 8rpx 19rpx 8rpx 9rpx;
				height: 61rpx;
				background: #FFFFFF;
				border: 1rpx solid #DADADA;
				border-radius: 41rpx;
				position: absolute;
				top: 0;
				left: 34rpx;
				display: flex;
				justify-content: center;
				align-items: center;
				font-weight: 400;
				.shop{
					width: 44rpx;
					height: 44rpx;
					margin-right: 8rpx;
				}
			}

			.close {
				position: absolute;
				top: 21rpx;
				right: 47rpx;
				line-height: initial;
				font-size: 40rpx;
			}
		}
        .content{
			margin-top: 10rpx;
			height: 1000rpx;
			overflow-y: scroll;
			width: 100%;
		}
	}
</style>
